package com.yc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.entity.Cartoon;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2022-05-25
 */
public interface CartoonMapper extends BaseMapper<Cartoon> {
    @Select("SELECT * from cartoon where ctid in (SELECT ctid from cmap where csid in (SELECT csid from categorysecord where csname=#{csname}))")
    public List< Cartoon > queryByCsname(String csname);

    @Select("SELECT * from cartoon where ctid in (SELECT ctid from cmap where ctid in (SELECT ctid from cmap where ctid in (SELECT ctid from cmap where ctid in (SELECT ctid from cmap where csid =(SELECT csid from categorysecord where csname=#{classname} and cid=1))\n" +
            "  and csid = (SELECT csid from categorysecord where csname=#{ctype} and cid=2)) \n" +
            "  and csid =(SELECT csid from categorysecord where csname=#{time} and cid=3))\n" +
            "  and csid =(SELECT csid from categorysecord where csname=#{version} and cid=4)) order by #{qtype} desc")
    public  List<Cartoon> queryjimdoo(String classname,String ctype, String time,String version,String qtype);
}
